﻿@{
    ViewBag.Title = "addAuthorInfo";
    Layout = "~/Views/Shared/_ViewMenu.cshtml";
}
<script src="/Content/After/js/jquery.min.js"></script>
<script>
    function addUserInfodo()
    {
        var AuthorName = $("#AuthorName").val();
        var AuthorUrl = $("#AuthorUrl").val();
        var AuthorParentId = $("#AuthorParentId").val();
        var AuthorState = $("#AuthorState").val();
        $.ajax({
            type:'post',
            url: '/AuthorInfo/FnaddUserInfodo',
            data:{
                AuthorState: AuthorState, AuthorName: AuthorName,
                AuthorUrl: AuthorUrl, AuthorParentId: AuthorParentId
            },
            success: function (mes) {
                if (mes > 0) {
                    alert("添加成功！");
                    location.href = '/AuthorInfo/Index';
                }
                else {
                    alert("添加失败！");
                }
            }
        })
    }
</script>
<div>
    <table>
        <tr>
            <td>名称：</td>
            <td><input id="AuthorName" type="text" /></td>
        </tr>
        <tr>
            <td>路径：</td>
            <td><input id="AuthorUrl" type="text" /></td>
        </tr>
        <tr>
            <td>上级菜单：</td>
            <td>@Html.DropDownList("AuthorParentId")</td>
        </tr>
        <tr>
            <td>状态：</td>
            <td>
             <select id="AuthorState">
                 <option value="1">启用</option>
                 <option value="0">禁用</option>
            </select>
            </td>
        </tr>
        <tr>
            <td><input id="Button1" type="button" value="添加" onclick="addUserInfodo()" /></td>
        </tr>
    </table>
</div>